[ENG-3999] Support IPv6 filer resolvers in drive mounts - #260
Conversation
🧪 Testing GuideWhat this PR addressesSandbox drive mounts failed on IPv6-only environments because the filer address parser in This PR:
Steps to reproduce the original issue
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
|
✅ Linked to Linear issue ENG-3999 — status already In Progress. Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
Interaction FlowsequenceDiagram
participant MD as MountDrive()
participant GFA as getFilerAddress()
participant PFA as parseFilerAddress()
participant RC as /etc/resolv.conf
participant FMT as formatFilerServerAddress()
participant SW as SeaweedFS (blfs)
MD->>GFA: resolve filer address
GFA->>PFA: parse resolv.conf content
PFA->>RC: read nameserver entries
RC-->>PFA: nameserver lines (IPv4 or IPv6)
PFA->>PFA: netip.ParseAddr() validates address
PFA-->>GFA: valid IP string (v4 or v6)
GFA-->>MD: filer address
MD->>FMT: format server address
FMT->>FMT: append ":httpPort.grpcPort"
FMT-->>MD: "host:49200.49201"
MD->>SW: mount with filer server address
SummaryThe PR refactors the drive mount filer resolution to support IPv6 nameservers in
This ensures sandboxes with IPv6-only resolvers can successfully mount Agent Drives. Note Posted by PR Sequence Diagram · Tag @mendral-app with feedback. |
|
Parking this pending owner review — @cploujoux, this is in your lane (ENG-3999), so handing it over rather than merging it myself. What is verified:
What is NOT verified, and why I stopped:
Pod One thing to weigh before merging: a push to |
mount_test.go conflicted add/add: both sides created the file with different tests. Resolved as a union — main's mount point, path and lock tests alongside this branch's IPv6 filer tests. mount.go merged cleanly, keeping netip-based parsing next to main's cross-mount cache and mount-lock changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
LGTM
My previous LGTM had no comments to address. The IPv6 parsing logic is unchanged. The merged-in code from main (mount locking, symlink-safe chown, idempotent mount detection) is well-structured with correct lock discipline — unmountDriveLocked is only called while already holding the per-path lock. Test coverage for the new helpers is thorough.
Tag @mendral-app with feedback or questions. View session
Summary
host:http.grpcaddress format for both address familiesRoot cause
Sandbox drive mounts treated the first resolver in
/etc/resolv.confas the filer, but validated it by requiring four dot-separated components. Current Blaxel sandboxes receive IPv6-only resolver addresses (for example2600:1f14:c75:3900::301), so the parser rejected the valid filer address beforeblfscould start. The SDK integration failures were downstream symptoms of that sandbox-api defect.The change uses
netip.ParseAddrinstead of an IPv4 shape check. It keeps the raw IPv6 literal in SeaweedFS'shost:http.grpcrepresentation; SeaweedFS splits on the final colon and brackets the host when it constructs HTTP and gRPC endpoints.Verification
GOTOOLCHAIN=go1.25.0 SHELL=/bin/sh go test -count=1 ./...GOTOOLCHAIN=go1.25.0 go test -race -count=1 ./src/handler/driveGOTOOLCHAIN=go1.25.0 go vet ./...GOTOOLCHAIN=go1.25.0 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ./...The test matrix proves the former IPv6 input now resolves while IPv4 behavior remains unchanged. Drive listing already splits mount sources at the final colon, so IPv6 mount sources remain compatible there as well.
Scope
This changes only filer-address discovery and formatting for drive mounts. It does not change DNS injection, networking, drive authorization, retries, or error suppression.
Linear: ENG-3999
Note
Merge of
maininto the IPv6 filer branch, incorporating mount-lock serialization,createMountPoint/chownMountPointsecurity hardening, workload identity UID/GID defaulting, cross-mount cache coherence flag, and comprehensive tests for all new helpers — alongside the original IPv6netip.ParseAddrchange.Written by Mendral for commit 1c60e83.
Note
Medium Risk
Touches the drive mount startup path where a bad address breaks all mounts, but the change is narrow and covered by unit tests; IPv4 behavior is preserved.
Overview
Fixes Agent Drive mounts when sandboxes use an IPv6-only first
nameserverin/etc/resolv.conf. Filer discovery no longer requires a four-part dotted IPv4 shape; it usesnetip.ParseAddron the first validnameserverline (including zoned IPv6) and skips malformed entries.blfs-filer=is built viaformatFilerServerAddress, which keeps SeaweedFS’shost:http.grpcform (ports49200.49201) with unbracketed IPv6 literals, matching how SeaweedFS splits on the final colon.Logic is split into testable
parseFilerAddress; new tests cover IPv4/IPv6, zones, malformed fallback, and address formatting.Reviewed by Cursor Bugbot for commit 1c60e83. Bugbot is set up for automated code reviews on this repo. Configure here.